57. Araxis Merge File Comparison Report

Produced by Araxis Merge on 2023-03-13 03:00:43 +0000. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a modern standards-compliant browser. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.

57.1 Files compared

#LocationFileLast Modified
1Porto v4.0.4/Porto Theme/app/code/Mageplaza/LayeredNavigation/Model/Category/Attribute/BackendAttributes.php2022-04-29 09:00:27 +0000
2Porto v4.0.5/Porto Theme/app/code/Mageplaza/LayeredNavigation/Model/Category/Attribute/BackendAttributes.php2022-12-08 01:34:28 +0000

57.2 Comparison summary

DescriptionBetween
Files 1 and 2
Text BlocksLines
Unchanged2150
Changed12
Inserted00
Removed00

57.3 Comparison options

WhitespaceConsecutive whitespace is treated as a single space
Character caseDifferences in character case are significant
Line endingsDifferences in line endings (CR and LF characters) are ignored
CR/LF charactersNot shown in the comparison detail
Active line-pairing rules

57.4 Active regular expressions

No regular expressions were active.

57.5 Comparison detail

1 <?php 1 <?php
2 /** 2 /**
3  * Mageplaza 3  * Mageplaza
4  * 4  *
5  * NOTICE OF LICENSE 5  * NOTICE OF LICENSE
6  * 6  *
7  * This source file is subject to the Mageplaza.com license that is 7  * This source file is subject to the Mageplaza.com license that is
8  * available through the world-wide-web at this URL: 8  * available through the world-wide-web at this URL:
9  * https://www.mageplaza.com/LICENSE.txt 9  * https://www.mageplaza.com/LICENSE.txt
10  * 10  *
11  * DISCLAIMER 11  * DISCLAIMER
12  * 12  *
13  * Do not edit or add to this file if you wish to upgrade this extension to newer 13  * Do not edit or add to this file if you wish to upgrade this extension to newer
14  * version in the future. 14  * version in the future.
15  * 15  *
16  * @category    Mageplaza 16  * @category    Mageplaza
17  * @package     Mageplaza_LayeredNavigation 17  * @package     Mageplaza_LayeredNavigation
18  * @copyright   Copyright (c) Mageplaza (https://www.mageplaza.com/) 18  * @copyright   Copyright (c) Mageplaza (https://www.mageplaza.com/)
19  * @license     https://www.mageplaza.com/LICENSE.txt 19  * @license     https://www.mageplaza.com/LICENSE.txt
20  */ 20  */
21  21 
22 namespace Mageplaza\LayeredNavigation\Model\Category\Attribute\Backend; 22 namespace Mageplaza\LayeredNavigation\Model\Category\Attribute\Backend;
23  23 
24 use Magento\Eav\Model\Entity\Attribute\Backend\AbstractBackend; 24 use Magento\Eav\Model\Entity\Attribute\Backend\AbstractBackend;
25 use Magento\Framework\DataObject; 25 use Magento\Framework\DataObject;
26   26 
27 /** 27 /**
28  * Class Attributes 28  * Class Attributes
29  * @package Mageplaza\LayeredNavigation\Model\Category\Attribute\Backend 29  * @package Mageplaza\LayeredNavigation\Model\Category\Attribute\Backend
30  */ 30  */
31 class Attributes extends AbstractBackend 31 class Attributes extends AbstractBackend
32 { 32 {
33     /** 33     /**
34      * Before Attribute Save Process 34      * Before Attribute Save Process
35      * 35      *
36      * @param DataObject $object 36      * @param DataObject $object
37      * @return $this 37      * @return $this
38      */ 38      */
39     public function beforeSave($object) 39     public function beforeSave($object)
40     { 40     {
41         $attributeCode = $this->getAttribute()->getName(); 41         $attributeCode = $this->getAttribute()->getName();
42         if ($attributeCode === 'mp_ln_hide_attribute_ids') { 42         if ($attributeCode === 'mp_ln_hide_attribute_ids') {
43             $data = $object->getData($attributeCode); 43             $data = $object->getData($attributeCode);
44             if (!is_array($data) || empty($data)) { 44             if (!is_array($data) || empty($data)) {
45                 $data = []; 45                 $data = [];
46             } 46             }
47             $object->setData($attributeCode, implode(',', $data)); 47             $object->setData($attributeCode, implode(',', $data));
48         } 48         }
49         if (!$object->hasData($attributeCode)) { 49         if (!$object->hasData($attributeCode)) {
50             $object->setData($attributeCode); 50             $object->setData($attributeCode);
51         } 51         }
52         return $this; 52         return $this;
53     } 53     }
54  54 
55     /** 55     /**
56      * After Load Attribute Process 56      * After Load Attribute Process
57      * 57      *
58      * @param DataObject $object 58      * @param DataObject $object
59      * @return $this 59      * @return $this
60      */ 60      */
61     public function afterLoad($object) 61     public function afterLoad($object)
62     { 62     {
63         $attributeCode = $this->getAttribute()->getName(); 63         $attributeCode = $this->getAttribute()->getName();
64         if ($attributeCode === 'mp_ln_hide_attribute_ids') { 64         if ($attributeCode === 'mp_ln_hide_attribute_ids') {
65             $data = $object->getData($attributeCode); 65             $data = $object->getData($attributeCode);
66             if ($data) { 66             if ($data) {
67                 if (is_array($data)) { 67                 if (is_array($data)) {
68                     $object->setData($attributeCode, $data); 68                     $object->setData($attributeCode, $data);
69                 } else { 69                 } else {
70                     $object->setData($attributeCode, explode(',', $data)); 70                     $object->setData($attributeCode, explode(',', $data));
71                 } 71                 }
72             } 72             }
73         } 73         }
74         return $this; 74         return $this;
75     } 75     }
76 } 76 }